﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<KaoWuYou.Models.TestModel>" %>

<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
    <% KaoWuYou.Models.TestModel model = (KaoWuYou.Models.TestModel)Session["Paper"];
    using (Html.BeginForm())
    { 
        switch (model.TestPaperModel.Questions[model.CurrentQuestion].Genre) 
        { 
            case "选择题":
            bool A = false, B = false, C = false, D = false;
            A = model.CurrentAnswer.Equals("A") ? true : false;
            B = model.CurrentAnswer.Equals("B") ? true : false;
            C = model.CurrentAnswer.Equals("C") ? true : false;
            D = model.CurrentAnswer.Equals("D") ? true : false; %>
            <div class="navi">
                <div class="pageTitle">
                    <h1><%: model.CurrentQuestion + 1 %>. <%: model.TestPaperModel.Questions[model.CurrentQuestion].Stem%></h1>
                </div>
            </div>
            <h4 class="option">
                <%: Html.RadioButton("SingleAnswer", "A", A)%>A.<%: model.TestPaperModel.Questions[model.CurrentQuestion].Options[0]%>
            </h4>
            <h4 class="option">
                <%: Html.RadioButton("SingleAnswer", "B", B)%>B.<%: model.TestPaperModel.Questions[model.CurrentQuestion].Options[1]%>
            </h4>
            <h4 class="option">
                <%: Html.RadioButton("SingleAnswer", "C", C)%>C.<%: model.TestPaperModel.Questions[model.CurrentQuestion].Options[2]%>
            </h4>
            <h4 class="option">
                <%: Html.RadioButton("SingleAnswer", "D", D)%>D.<%: model.TestPaperModel.Questions[model.CurrentQuestion].Options[3]%>
            </h4>
               <% break; %>
     <% } %>
        <div>
         <% if (model.CurrentQuestion != 0)
            { %>
                <div class="defBtn" style=" float: left; left: 230px; position:absolute;">
                    <input type="submit" name="Last" value="上一题" />
                </div>
         <% }
            if (model.CurrentQuestion < model.TestPaperModel.Questions.Count - 1)
            { %>
                <div class="defBtn" style=" float: left; left: 330px; position:absolute;">
                    <input type="submit" name="Next" value="下一题" />
                </div>
         <% }
            if (model.CurrentQuestion == model.TestPaperModel.Questions.Count - 1)
            { %>
                <div class="defBtn" style=" float: left; left: 430px; position:absolute;">
                    <input type="submit" name="Submit" value="提交试卷" />
                </div>
         <% } %>
        </div>
 <% } %>

</asp:Content>
